//
//  LabelTableViewCell.m
//  UI_APP_Project_Bean
//
//  Created by dllo on 16/6/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LabelTableViewCell.h"
#import "GetHeightTools.h"
#import "ActivityModel.h"

@interface LabelTableViewCell ()

@property(nonatomic, retain)UILabel*contentText;

@end

@implementation LabelTableViewCell

- (void)dealloc
{
    [_contentText release];
    [_activityModel release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
   self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self ) {

        self.contentText = [[UILabel alloc]init];
        self.contentText.font = [UIFont systemFontOfSize:13];
        _contentText.numberOfLines = 0;
        [self.contentView addSubview:_contentText];
        [_contentText release];
        

        
        
    }

    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    CGFloat height =[GetHeightTools heightWith:self.activityModel.content];
    self.contentText.frame =CGRectMake(15, 0, self.contentView.frame.size.width - 30, height);
    
}

-(void)setActivityModel:(ActivityModel *)activityModel{
    if (_activityModel != activityModel) {
        [_activityModel release];
        _activityModel = [activityModel retain];
    }
    
    self.contentText.text = self.activityModel.content;
}


@end
